package com.gold.bullion.activity;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.gold.bullion.R;

public class MainMenuCell extends LinearLayout {
	private Context mContext;

	public MainMenuCell(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.mContext = context;
		initContentView();
	}

	public MainMenuCell(Context context) {
		super(context);
		this.mContext = context;
		initContentView();
	}

	private void initContentView() {

		LayoutInflater.from(mContext)
				.inflate(R.layout.mainmenucell, this, true);

	}

	public void resize(int width, int height) {

		LinearLayout layout = (LinearLayout) this
				.findViewById(R.id.cellItemLayout);
		ViewGroup.LayoutParams param = layout.getLayoutParams();
		if (width > 0)
			param.width = width;
		if (height > 0)
			param.height = height;
		layout.setLayoutParams(param);
	}

	public ImageView getImageView() {
		return (ImageView) this.findViewById(R.id.imageView1);
	}

	public TextView getTextView() {
		return (TextView) this.findViewById(R.id.textView1);
	}

}
